import loading from '@/components/xuan-loading/xuan-loading.vue'
import fromItem from '@/components/from-item/from-item.vue'
import {
	log
} from 'util'
export default {
	props: {
		mustIcon: {
			type: String,
			default: require('@/static/Scope.png'),
		},
		unIcon: {
			type: String,
			default: require('@/static/unscope.png'),
		}
	},
	data() {
		return {
			Inv: 0,
			// 详情
			totalData: {
				fId: "", // 申请单fid //为空判断为新增
				fInspectionnote: "", //报验申请
				fDirectoruserid: "", //技术负责人id
				fDirectorusername: "", //技术负责人
				fInspectiondates: "", //报验时间日期
				fJluserid: "", //提请专监审核人id
				fJlusername: "", //提请专监审核人

				fJladuitnote: "", //专监审核意见
				fJladuituserid: "", //专业监理工程师id
				fJladuitusername: "", //专业监理工程师
				fJladuitdates: "" //审核日期
			}, //详情数据
			// 详情

			// loading样式
			width: '150rpx',
			height: '100rpx',
			shadeShow: false,
			backgroundColor: "transparent",
			themeColor: '#33CCCC',
			// loading样式

			userInfo: null, //当前登录用户
			timing: null, //当前年月日
		};
	},



	onLoad(options) {
		var that = this;
		uni.getStorage({
			key: 'userInfo',
			success: function(res) {
				that.userInfo = JSON.parse(res.data);
			}
		});
		that.getFdata(options);
		// #ifdef APP-PLUS
		// #endif
		
		// #ifdef H5
		// #endif
	},
	onShow() {},
	onReady() {},
	components: {
		loading,
		fromItem
	},

	onUnload() {
		uni.$off('drawer-page')
	},

	methods: {
		// 切换表头
		yj_searchForm(num) {
			var that = this;
			this.Inv = num;
		},

		getFdata(data) {
			this.Inv = 0;
			this.getDetailData(data.id, this.Inv);
		},
		getDetailData(id, num) {
			this.$http.getInspectionFormByFid({
					fId: id
				})
				.then((res) => {
					if (res.errcode == 0) {
						var that = this;
						that.totalData = res.data.inspectionform;
					} else {
						uni.showToast({
							title: "详情接口出错",
							icon: 'none',
							duration: 2000
						});
						return false;
					}
				})
				.catch((error) => {
					console.log("详情接口报错");
					return false;
				});


		},

		// 原生窗体按钮显示
		// playVideo() {
		// 	let subNVue = uni.getSubNVueById('safe_notice')
		// 	subNVue.show()
		// },
		callback() {},

	}
}
